const Koa = require('koa')
const catchException = require('./middleware/catchException.js')
const validator = require('./middleware/koa-validator.js')
const routes = require('./router/router.js')


const app = new Koa()

// 异常处理
app.use(catchException)
// 验证器
app.use(validator)

app.use(routes)



module.exports = app